<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/WEB-INF/page/include.inc.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
	$(document).ready(function(){
		initZtree("ztreeId", "");
	});
	
	function gain() {
		var treeObj = $.fn.zTree.getZTreeObj("ztreeId");
	    var nodes = treeObj.getCheckedNodes(true);
	    var v = "";
	    for(var i=0; i<nodes.length; i++) {
	    	if (v != '') {
				v += ',';
			}
			v += nodes[i].id;
	    }
	    $("#privilegeId").val(v);
		submitForm("角色管理");
	}
</script>
</head>
<body >
	<div style="padding:20px 0px 10px 100px">
		<form id="formId" action="add" method="post">
			<input type="hidden" id="privilegeId" name="role.privilegeId"></input>
			<table>
				<tr>
					<td>角色名称:</td>
					<td><input type="text" name="name" data-options="required:true"></input></td>
				</tr>
				<tr>
					<td>描述:</td>
					<td><input type="text" name="describes"></input></td>
				</tr>
			</table>
			<ul id="ztreeId" class="ztree"></ul>
			<div style="padding:20px 0 10px 70px">
				<input type="button" value="提交" onclick="gain();"></input>
				<input type="button" value="取消" onclick="self.parent.closeCurrTab();"></input>
			</div>
		</form>
	</div>
</body>
</html>
